<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Cron帮助</title>
    <meta name="description" content="生成器在线生成任务调度比如Quartz的Cron表达式,对Quartz Cron表达式的可视化双向解析和生成.">
    <meta name="author" content="zeyuphoenix">

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <!-- #CSS Links -->
    <!-- Basic Styles -->
    <link rel="stylesheet" type="text/css" media="screen" href="/static/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" media="screen" href="/static/css/font-awesome.css">

    <!-- SmartAdmin Styles : Caution! DO NOT change the order -->
    <link rel="stylesheet" type="text/css" media="screen" href="/static/css/smartadmin-production-plugins.css">
    <link rel="stylesheet" type="text/css" media="screen" href="/static/css/smartadmin-production.css">
    <link rel="stylesheet" type="text/css" media="screen" href="/static/css/smartadmin-skins.css">

    <!-- #FAVICONS -->
    <link rel="shortcut icon" href="/static/img/favicon/favicon.ico" type="image/x-icon">
    <link rel="icon" href="/static/img/favicon/favicon.ico" type="image/x-icon">

    <!-- #GOOGLE FONT -->
    <link rel="stylesheet" href="/static/css/google-fonts.css?family=Open+Sans:300,400,600&subset=latin,latin-ext">

    <!-- #APP SCREEN / ICONS -->
    <!-- Specifying a Webpage Icon for Web Clip
         Ref: https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html -->
    <link rel="apple-touch-icon" href="/static/img/splash/sptouch-icon-iphone.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/static/img/splash/touch-icon-ipad.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/static/img/splash/touch-icon-iphone-retina.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/static/img/splash/touch-icon-ipad-retina.png">

    <!-- iOS web-app metas : hides Safari UI Components and Changes Status Bar Appearance -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <!-- Startup image for web apps -->
    <link rel="apple-touch-startup-image" href="/static/img/splash/ipad-landscape.png"
          media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape)">
    <link rel="apple-touch-startup-image" href="/static/img/splash/ipad-portrait.png"
          media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait)">
    <link rel="apple-touch-startup-image" href="/static/img/splash/iphone.png"
          media="screen and (max-device-width: 320px)">

    <style>
        #main {
            margin-left: 0;
            padding: 0;
            position: relative;
        }

        .log-main {
            position: relative;
            padding: 0 6px 0 14px;
        }

        pre {
            white-space: pre-wrap;
            word-wrap: break-word;
            color: #DDDDDD;
            width: 100%;
            height: 520px;
            border: 0;
            background-color: #000000;
            overflow: auto
        }

        #result {
            margin-top: -20px;
            margin-bottom: 10px;
        }
    </style>

</head>

<!--

TABLE OF CONTENTS.

Use search to find needed section.

===================================================================

|  01. #CSS Links                |  all CSS links and file paths  |
|  02. #FAVICONS                 |  Favicon links and file paths  |
|  03. #GOOGLE FONT              |  Google font link              |
|  04. #APP SCREEN / ICONS       |  app icons, screen backdrops   |
|  05. #BODY                     |  body tag                      |
|  06. #HEADER                   |  header tag                    |
|  07. #MAIN PANEL               |  main panel                    |
|  08. #MAIN CONTENT             |  content holder                |
|  09. #PLUGINS                  |  all scripts and plugins       |

===================================================================
-->

<!-- #BODY -->
<body class="">

<!-- #MAIN PANEL -->
<div id="main" role="main">

    <!-- #MAIN CONTENT -->
    <div class="log-main">
        <div class="margin-top-5"></div>
        <pre id="repre">
            <div id="result"></div>
            <div class='waitray'>_</div>
        </pre>

    </div>

</div>
<!-- END #MAIN PANEL -->

<!--================================================== -->

<!-- #PLUGINS -->
<!-- Link to Google CDN's jQuery + jQueryUI; fall back to local -->
<script src="/static/js/libs/jquery-2.2.0.js"></script>

<script src="/static/js/libs/jquery-ui-1.11.4.js"></script>

<!-- IMPORTANT: APP CONFIG -->
<script src="/static/js/app.config.js"></script>

<!-- JS TOUCH : include this plugin for mobile drag / drop touch events-->
<script src="/static/js/plugin/jquery-touch/jquery.ui.touch-punch.js"></script>

<!-- BOOTSTRAP JS -->
<script src="/static/js/bootstrap/bootstrap.js"></script>

<!-- JARVIS WIDGETS -->
<script src="/static/js/smartwidgets/jarvis.widget.js"></script>

<!-- JQUERY UI + Bootstrap Slider -->
<script src="/static/js/plugin/bootstrap-slider/bootstrap-slider.js"></script>

<!-- browser msie issue fix -->
<script src="/static/js/plugin/msie-fix/jquery.mb.browser.js"></script>

<!-- FastClick: For mobile devices: you can disable this in app.js -->
<script src="/static/js/plugin/fastclick/fastclick.js"></script>

<!-- layer plugin -->
<script src="/static/js/plugin/layer/layer.js"></script>

<!-- MAIN APP JS FILE -->
<script src="/static/js/app.js"></script>

<!-- SCRIPTS ON PAGE EVENT -->
<script type="text/javascript">
    /* DO NOT REMOVE : GLOBAL FUNCTIONS!
     *
     * pageSetUp(); WILL CALL THE FOLLOWING FUNCTIONS
     *
     * // activate tooltips
     * $("[rel=tooltip]").tooltip();
     *
     * // activate popovers
     * $("[rel=popover]").popover();
     *
     * // activate popovers with hover states
     * $("[rel=popover-hover]").popover({ trigger: "hover" });
     *
     * // activate inline charts
     * runAllCharts();
     *
     * // setup widgets
     * setup_widgets_desktop();
     *
     * // run form elements
     * runAllForms();
     *
     ********************************
     *
     * pageSetUp() is needed whenever you load a page.
     * It initializes and checks for all basic elements of the page
     * and makes rendering easier.
     *
     */
    pageSetUp();

    /*
     * ALL PAGE RELATED SCRIPTS CAN GO BELOW HERE
     */
    // PAGE RELATED SCRIPTS
    // pagefunction
    var pagefunction = function () {

        window.setInterval(doRay, 500);
        var waitRay = 0;

        var $tray = $(".waitray");
        // 打印提示
        function doRay() {
            waitRay++;
            if (waitRay == 1) $tray.text("_");
            else if (waitRay == 2) $tray.text(" ");
            else {
                waitRay = 0;
                $tray.text("_");
            }
        }

        var $result = $('#result');
        //此方法由window.parent.updateLogger
        function updateLogger(data) {
            if (data == null || data == "") {
                return;
            }
            var color = "txt-color-blueLight";
            if (data.indexOf('INFO') >= 0)
                color = "txt-color-green";
            else if (data.indexOf('WARN') >= 0)
                color = "txt-color-yellow";
            else if (data.indexOf('ERROR') >= 0)
                color = "txt-color-red";
            data = data.replace("[", " [<span class='" + color + "'>");
            data = data.replace("]", "</span>]");
            $result.append(data);
            $result.append("<br/>");
        }

        // 防止多次滚动标志位
        var finished = false;
        // 滚动到底部加载
        var winH = $(window).height(); //页面可视区域高度
        var position = 0; //设置当前位置
        $('#repre').scroll(function () {
            var pageH = $result.height();
            var scrollT = $('#repre').scrollTop(); //滚动条top
            var aa = (pageH - winH - scrollT) / winH;
            if (aa < 0.04 && finished == false) {
                finished = true;
                requestLog();
            }
        });

        // 获取日志
        function requestLog() {
            $.ajax({
                url: '${ctx}/tools/logger/read',
                type: 'POST',
                dataType: 'json',
                data: {position: position},
                success: function (data) {
                    if (data) {
                        position = data['position'];
                        var logs = data['data'];
                        if (logs && logs != '') {
                            var logArr = logs.split("$$$$$");

                            $.each(logArr, function (index, value) {
                                if (value != '') {
                                    updateLogger(value);
                                }
                            });
                        }
                    }
                    finished = false;
                }
            });
        }

        requestLog();
    };

    // destroy generated instances
    // pagedestroy is called automatically before loading a new page
    // only usable in AJAX version!
    var pagedestroy = function () {
    };
    // end destroy

    // load related plugins
    pagefunction();

</script>
<!-- END #MAIN CONTENT -->

</body>

</html>